package com.gxgeek.product.service;

import com.gxgeek.product.common.DecreaseStockInput;
import com.gxgeek.product.common.ProductInfoOutput;
import com.gxgeek.product.dataobject.ProductInfo;
import com.gxgeek.product.dto.CartDTO;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.util.List;

/**
 * Created by Administrator on 2017/7/11.
 */
public interface ProductService {
    //查询上架商品
    List<ProductInfo> findByProductStatus(Integer status);
    //查询所有上架商品
    List<ProductInfo> findUpAll();

    //分页查找商家商品
    Page<ProductInfo> findAll(Pageable pageable);
    //查询单个商品
    ProductInfo   findOne(String productId);

    //保存商品
    ProductInfo save(ProductInfo productInfo);
    //加库存
    void increaseStock(List<CartDTO> list);
    //减库粗
    void decreaseSock(List<CartDTO> list);


    //上架
    ProductInfo onSale(String productId);
    //下架
    ProductInfo offSale(String productId);

    List<ProductInfoOutput> findList(List<String> productIdList);

    List<ProductInfo> decreaseStock(List<DecreaseStockInput> decreaseStockInputList);
}
